package de.uniwue.cs.ir.vsr;

import java.util.List;

public class TokenOccurrenceImpl implements ITokenOccurrence {

	private IDocument doc;
	private List<Integer> positions;
	private double weight = -42;
	
	public TokenOccurrenceImpl(IDocument doc, List<Integer> positions) {
		this.doc = doc;
		this.positions = positions;
	}
	
	@Override
	public int compareTo(ITokenOccurrence occ) {
		double occWeight = occ.getWeight();  
		return (int)Math.signum(weight - occWeight);    
	}

	@Override
	public IDocument getDocument() {
		return doc;
	}
	
	@Override
	public void setWeight(double weight) {
		this.weight = weight;
	}

	@Override
	public double getWeight() {
		return weight;
	}

	@Override
	public List<Integer> getPositions() {
		return positions;
	}

}
